PSS example 70.mws

PSS-ex42.mws        Power Series Solution    example 42:     [Maple OLE 2.0 Object]

>    restart;

>    c[0];

c[0]

>    c[1];

c[1]

>    c[2]:=0;

c[2] := 0

>    c[3]:=0;

c[3] := 0

define the number of terms in partial summation:

>    M:=11;

M := 11

recursion formula:       [Maple OLE 2.0 Object]  

>    for m from 0 to M do c[m+4]:=c[m]/(m+3)/(m+4) od;

c[4] := 1/12*c[0]

c[5] := 1/20*c[1]

c[6] := 0

c[7] := 0

c[8] := 1/672*c[0]

c[9] := 1/1440*c[1]

c[10] := 0

c[11] := 0

c[12] := 1/88704*c[0]

c[13] := 1/224640*c[1]

c[14] := 0

c[15] := 0

>    m:='m':

Partial sum of Solution:

>    y(x):=sum(c[m]*x^m,m=0..M);

y(x) := c[0]+c[1]*x+1/12*c[0]*x^4+1/20*c[1]*x^5+1/672*c[0]*x^8+1/1440*c[1]*x^9

>    y(x):=sort(y(x),c[0]);

y(x) := c[0]+1/12*x^4*c[0]+1/672*x^8*c[0]+c[1]*x+1/20*c[1]*x^5+1/1440*c[1]*x^9

>    y(x):= collect(y(x),{c[0],c[1]});

(1/672*x^8+1+1/12*x^4)*c[0]+(1/20*x^5+1/1440*x^9+x)*c[1]

Family of solution curves for different values of coefficients c[0] and c[1]

>    f:=subs({c[0]=i/2,c[1]=j/2},y(x)):

>    f:={seq(seq(f,i=-4..4),j=-4..4)}:

>    plot(f,x=-2..2,y=-4..4,color=black);

[Maple Plot]

Initial Value Problem:        y(0)=1,   y'(0)=0.5

>    subs(x=0,y(x));

c[0]

>    subs(c[0]=1,y(x));

1+1/12*x^4+1/672*x^8+c[1]*x+1/20*c[1]*x^5+1/1440*c[1]*x^9

>    diff(%,x);

1/3*x^3+1/84*x^7+c[1]+1/4*c[1]*x^4+1/160*c[1]*x^8

>    subs(x=0,%);

c[1]

>    Y(x):=subs({c[0]=1,c[1]=0.5},y(x));

Y(x) := 1+1/12*x^4+1/672*x^8+.5*x+.2500000000e-1*x^5+.3472222222e-3*x^9

>    plot(Y(x),x=-2..2,y=-1..4);

[Maple Plot]